﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.MultiUserAdminPageBase" %>
<ali:Get ID="Config" Object="InstanceConfig" Operation="GetBasicSettings()" />
<ali:List ID="SubSite" Object="Site" Condition="SubInstanceID=Manager.User['DefaultSubInstanceIDOf' + InstanceID]" />
<script language="c#" runat="server">
protected string CurrentCategoryID
{
	get
	{
		if (!String.IsNullOrEmpty(Request.QueryString["CategoryID"]))
			return Request.QueryString["CategoryID"];
		else if (Request.Cookies["CategoryID"] != null)
			return Request.Cookies["CategoryID"].Value;
		else
			return null;
	}
}
</script>
<section data-page="menu_add" data-title="添加菜单" data-site-domain="<%=Site[Domain]%>" data-sub-site-domain="<%=SubSite[Domain]%>" data-web-path="<%=Config[ActualUrl].Replace("{#PageID#}", Convert.ToString(SubSite[PageID]))%>">
	<div class="path1"><span>您的位置：</span>添加菜单</div>
	<form action="" class="post">
		<div class="post-body">
			<table class="post-table">
				<tr>
					<th>名称：</th>
					<td><input type="text" name="Name" size="50" maxlength="255" class="ali-input ali-input-required <%=ContentLang%>Font"></td>
				</tr>
				<tr>
					<th>类别：</th>
					<td>
						<label><input type="radio" name="CategoryType" value="main" checked>主菜单</label>
						<label><input type="radio" name="CategoryType" value="footer">脚注菜单</label>
						<label><input type="radio" name="CategoryType" value="more">指定类别</label>

						<span style="display:none">
							<ali:Tree Object="MenuCategory" Validate="True">
								<select name="CategoryID" class="<%=ContentLang%>Font" data-ali-widget="combo" data-tree="true" data-root="0">
									<ali:Record>
										<%If Convert.ToString(ID) == CurrentCategoryID%>
											<option value="<%=ID%>" data-item="<%=ParentChain%>.<%=InnerID%>" data-parent="<%=ParentChain%>" selected><%=Name%></option>
										<%Else%>
											<option value="<%=ID%>" data-item="<%=ParentChain%>.<%=InnerID%>" data-parent="<%=ParentChain%>"><%=Name%></option>
										<%EndIf%>
										<%=ChildRecords%>
									</ali:Record>
								</select>
							</ali:Tree>
						</span>
					</td>
				</tr>
				<tr>
					<th>上级：</th>
					<td>
						<select name="ParentID" class="<%=ContentLang%>Font" data-ali-widget="combo" data-tree="true" data-root="0">
							<option value="" data-item="" data-parent="0">未指定</option>
						</select>
					</td>
				</tr>
				<tr>
					<th>图片：</th>
					<td>
						<input type="text" name="Picture" size="55" class="ali-input">
						<a class="ali-button ali-uploader">浏览...</a>
						<input type="hidden" name="PictureAllowedType" value="gif|jpg|jpeg|png|bmp">
					</td>
				</tr>
				<tr>
					<th>类型：</th>
					<td>
						<label><input type="radio" name="Type" value="Content" checked>内容</label>
						<label><input type="radio" name="Type" value="InnerLink">内链</label>
						<label><input type="radio" name="Type" value="OuterLink">外链</label>
					</td>
				</tr>
				<tr>
					<th>网址：</th>
					<td>
						<select name="ChannelID" class="<%=ContentLang%>Font" data-ali-widget="combo" data-tree="true" data-root="0">
							<ali:Tree Object="Channel">
								<ali:Record>
									<option value="<%=ID%>" data-path="<%=Path%>" data-template-path="<%=TemplatePath%>" data-item="<%=ParentChain%>.<%=InnerID%>" data-parent="<%=ParentChain%>"><%=Name%></option>
									<%=ChildRecords%>
								</ali:Record>
							</ali:Tree>
						</select>
						<select name="PageTemplate" data-ali-widget="combo"></select>
						<input type="text" name="Path" size="60" maxlength="255" class="ali-input" style="display:none">
						<div>最终结果：<span data-id="url"></span></div>
					</td>
				</tr>
				<tr>
					<th>内容：</th>
					<td>
						<textarea name="Content" data-lang="<%=ContentLang%>" data-instance-id="<%=InstanceID%>" class="editor"></textarea>
					</td>
				</tr>
				<tr>
					<th>是否显示：</th>
					<td>
						<label><input type="radio" name="IsDisplay" checked>是</label>
						<label><input type="radio" name="IsDisplay">否</label>
					</td>
				</tr>
			</table>
		</div>
		<div class="post-footer"><button type="submit" class="ali-button">保 存</button></div>
	</form>
</section>